package com.dsj.gxrd.modules.activity.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dsj.gxrd.modules.activity.domain.entity.RdBanner;
import com.dsj.gxrd.modules.activity.mapper.RdBannerMapper;
import com.dsj.gxrd.modules.activity.service.RdBannerService;
import com.dsj.gxrd.utils.BaseEntityHandlerUtils;
import com.ruoyi.common.core.utils.StringUtils;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.security.utils.SecurityUtils;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author songpin566
 * @date 2023/10/13
 **/
@Service
public class RdBannerServiceImpl extends ServiceImpl<RdBannerMapper, RdBanner> implements RdBannerService {


    @Override
    public List<RdBanner> selectBannerList(RdBanner banner) {
        String introduction = banner.getIntroduction();
        return this.lambdaQuery().eq(RdBanner::getDelFlag, 0).eq(RdBanner::getStartStatus,1)
                .like(StringUtils.isNotEmpty(introduction), RdBanner::getIntroduction, introduction).list();
    }

    @Override
    public RdBanner getInfo(Long id) {
        return this.getById(id);
    }

}
